package com.lcc.lynx.jdbc.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.lcc.lynx.common.utils.SSupplier;
import com.lcc.lynx.jdbc.ec.EnhanceCondition;

import java.io.Serializable;
import java.util.List;

public class TablePojo extends TempParam {

    /**
     * 更新对象值 arg0
     */
    @JsonIgnore
    private Object a0;

    public Object getA0() {
        return a0;
    }

    /**
     * 设置更新对象
     *
     * @param a0
     * @author lcc
     * @date 2025/7/14 19:24
     */
    public final void setUpdateObj(Object a0) {
        this.a0 = a0;
    }

    /**
     * 设置id列表
     *
     * @param idList id列表
     * @author lcc
     * @date 2025/7/14 19:23
     */
    public <T> T setIdInList(List<? extends Serializable> idList) {
        this.put("idList", idList);
        this.put("idInList", idList);
        return (T) this;
    }

    /**
     * 添加增强查询条件
     *
     * @param getFun   字段get方法
     * @author lcc
     * @date 2025/7/14 19:22
     */
    public EnhanceCondition and(SSupplier getFun) {
        return new EnhanceCondition(getFun, this);
    }

    public EnhanceCondition and() {
        return new EnhanceCondition(this);
    }
}
